import P2mLogger from 'p2m-common-logger';

export default function (category: any, path?: string): any {
  if (typeof category === 'function') {
    category.prototype.logger = new P2mLogger(category.name);
    return;
  }

  return (target: any, key: string, descriptor: any) => {
    target.prototype.logger = new P2mLogger(category, path);
    return descriptor;
  };

}
